package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishItemVO;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface SetmealMapper {

    List<Setmeal> setSearch(Integer categoryId);

    @AutoFill(OperationType.INSERT)
    void addSet(Setmeal setmeal);

    void setDishs(SetmealDish setmealDish, Long id);

    Long count(SetmealPageQueryDTO setmealPageQueryDTO);

    List<SetmealVO> PageSearch(SetmealPageQueryDTO setmealPageQueryDTO, Long start);

    Setmeal getByid(Integer id);

    List<SetmealDish> getByDishID(Long setid);

    void ChangeStatus(Integer status, Integer id);

    @AutoFill(OperationType.UPDATE)
    void changeSet(Setmeal setmeal);

    void chanDishSet(Long id);

    void addSetDish(SetmealDish setmealDish);

    void DropSetmeal(Integer[] ids);

    void DropSetmealDish(Integer[] ids);

    List<DishItemVO> getBySetmealId(Integer id);

    @Select("select *from setmeal where category_id = #{categoryId}")
    List<Setmeal> setSearch1(Integer id);

    int HavingSet(Integer[] ids);

    int SearchSetStatus(Integer[] ids);

    List<Integer> getDontStatusDish(Integer id);

    @Select("select count(*) from setmeal where status=#{status}")
    Integer countByMap(Map map);
}
